package com.example.mapper.institutioncare.institutionadmin;

import com.example.bean.carecommunity.SafetySystem;
import com.example.bean.configuration.zhibiaosystem.XzLiebiao;
import com.example.bean.configuration.zhibiaosystem.Zhibiao;
import com.example.bean.institutioncare.institutionadmin.Basicdata;
import com.example.bean.institutioncare.institutionadmin.BasicdataVo;
import com.example.bean.institutioncare.institutionadmin.BasicinformationMessage;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public interface BasicMapper{

    List<Basicdata> selectPageInfo(BasicdataVo vo);

    List<Basicdata> selectInfo();

    @Select("select * from zhibiao zb where sf_del=1 ORDER BY create_date ASC")
    List<Zhibiao> addInner();

    @Select("select * from xz_liebiao xl JOIN zhibiao zb ON xl.zb_id=zb.noid ORDER BY zbx_name ASC")
    List<XzLiebiao> addInners();

    Integer addBasicdata(Basicdata basics);

    void addSafetySystem(SafetySystem safety);

    @Select("select xl.noid,xl.zb_id from xz_liebiao xl where xl.noid=#{noids}")
    XzLiebiao seachInners(String noids);

    void addBasicMessage(BasicinformationMessage basicmessage);

    @Select("select * from t_basicinformation_message where basic_id=#{noid}")
    List<BasicinformationMessage> putBasicdata(String noid);

    @Select("select * from safety_system where basic_id=#{noid}")
    List<SafetySystem> putSafetym(String noid);

    Integer updaBasicdata(Basicdata basics);

    Integer updaSafetySystem(SafetySystem safety);

    @Delete("delete from t_basicinformation_message where basic_id=#{noid}")
    void deleteBasicMessage(String noid);

    @Update("update t_basicinformation set id_delete='0' where noid=#{noid}")
    Integer delete(String noid);

}